define(['app'], function(app) {
	'use strict';

	//实例化方法
	var factory = function(Http) {

		//返回信息
		return {
			//明细一览。还款：repay      欠款：pay
			credit_list: function(store_id,nPage, type ,callback,calldone) {
				Http.post({
					method: 'member.supplier.credit.getlist',
					store_id: store_id,
					nPage:nPage,
					pagelimit:10,
					type:type
				}, function(result) {
					if(callback)
						callback(result.result);
				}, function(e) {

				}, function() {
					if(calldone)
						calldone();
				})
			}
			

		};
	}

	factory.$inject = ['Http'];
	return app.registerService("Credit_repayment_list", factory);
});